package sctu.edu.java.year2016.team07.shihaocheng.day20160522.Chapter6_3;

/**
 * Created by admin on 2016/5/22.
 *将今天的信息全部格式化，并以"年-月-日输出"
 */
import java.util.Date;

public class chapter6_3 {
    public static void main(String[] args) {
        Date today = new Date();
        String a = String.format("%tb",today);//月份简称
        String b = String.format("%ta",today);//星期简称
        String c = String.format("%tY",today);//年份
        String d = String.format("%tm",today);//月份
        String e = String.format("%td",today);//第几天
        String f = String.format("%tH",today);//24小时制的小时
        String g = String.format("%tM",today);//分钟
        String h = String.format("%tS",today);//秒

        System.out.println("月份的中文简称为:"+a);

        System.out.println("今天是星期几:"+b);

        System.out.print("今天的日期是:"+(c)+"-"+(d)+"-"+(e)+"."+(f)+":"+(g)+":"+(h)+"");
    }
}
